﻿Imports System.Data.SqlClient
Public Class DF12
    Inherits Conexion
    Dim cmd As New SqlCommand
    Public Function guardar(ByVal dts As Entidades.EF12MotoVehiculos) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_guardar_F12M")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@num_formulario", dts.numformu)
            cmd.Parameters.AddWithValue("@dominio", dts.dominioo)
            cmd.Parameters.AddWithValue("@marca", dts.marcaa)
            cmd.Parameters.AddWithValue("@tipo", dts.tipoo)
            cmd.Parameters.AddWithValue("@modelo", dts.modeloo)
            cmd.Parameters.AddWithValue("@marcamotor", dts.marcamotorr)
            cmd.Parameters.AddWithValue("@nummotor", dts.nummotorr)
            cmd.Parameters.AddWithValue("@marcacuadro", dts.marcacuadroo)
            cmd.Parameters.AddWithValue("@numcuadro", dts.numcuadroo)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)
            cmd.Parameters.AddWithValue("@lugar", dts.lugarr)
            cmd.Parameters.AddWithValue("@dia", dts.diaa)
            cmd.Parameters.AddWithValue("@mes", dts.mess)
            cmd.Parameters.AddWithValue("@año", dts.añoo)
            cmd.Parameters.AddWithValue("@apenom", dts.apenomm)
            cmd.Parameters.AddWithValue("@documento", dts.documentoo)
            cmd.Parameters.AddWithValue("@calle", dts.callee)
            cmd.Parameters.AddWithValue("@num", dts.numm)
            cmd.Parameters.AddWithValue("@localidad", dts.localidadd)
           
            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function

    Public Function modificar(ByVal dts As Entidades.EF12MotoVehiculos) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_editar_F12M")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@num_formulario", dts.numformu)
            cmd.Parameters.AddWithValue("@dominio", dts.dominioo)
            cmd.Parameters.AddWithValue("@marca", dts.marcaa)
            cmd.Parameters.AddWithValue("@tipo", dts.tipoo)
            cmd.Parameters.AddWithValue("@modelo", dts.modeloo)
            cmd.Parameters.AddWithValue("@marcamotor", dts.marcamotorr)
            cmd.Parameters.AddWithValue("@nummotor", dts.nummotorr)
            cmd.Parameters.AddWithValue("@marcacuadro", dts.marcacuadroo)
            cmd.Parameters.AddWithValue("@numcuadro", dts.numcuadroo)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)
            cmd.Parameters.AddWithValue("@lugar", dts.lugarr)
            cmd.Parameters.AddWithValue("@dia", dts.diaa)
            cmd.Parameters.AddWithValue("@mes", dts.mess)
            cmd.Parameters.AddWithValue("@año", dts.añoo)
            cmd.Parameters.AddWithValue("@apenom", dts.apenomm)
            cmd.Parameters.AddWithValue("@documento", dts.documentoo)
            cmd.Parameters.AddWithValue("@calle", dts.callee)
            cmd.Parameters.AddWithValue("@num", dts.numm)
            cmd.Parameters.AddWithValue("@localidad", dts.localidadd)

            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function
End Class

